import request from '@/utils/request'
import { data } from 'autoprefixer'

// 获取所有规则
export const getListApi = params => {
  return request({
    url: '/knowledgeAdmin/rule/list',
    method: 'get',
    params,
  })
}


// 删除
export const deleteApi = ids => {
  return request({
    url: '/knowledgeAdmin/rule/delete',
    method: 'delete',
    data: ids,
  })
}

// 修改
export const updateApi = data => {
  return request({
    url: '/knowledgeAdmin/rule/update',
    method: 'put',
    data,
  })
}
// 添加
export const saveApi = data => {
  return request({
    url: '/knowledgeAdmin/rule/save',
    method: 'post',
    data,
  })
}

// 获取规则信息
export const getInfoApi = id => {
  return request({
    url: `/knowledgeAdmin/rule/info/${id}`,
    method: 'get',
  })
}

// 获取可用数据集
export const getDataSetApi = () => {
  return request({
    url: `/knowledgeAdmin/rwjgjf/getUncheckDataSet`,
    method: 'get',
  })
}

// 规则检测
export const checkApi = data => {
  return request({
    url: `/knowledgeAdmin/rule/check`,
    method: 'post',
    data,
  })
}

// 检测结果复核
export const reCheckApi = ids => {
  return request({
    url: `/knowledgeAdmin/checkResult/reCheck`,
    method: 'post',
    data: ids,
  })
}

// 获取所有检测结果
export const getCheckListApi = params => {
  return request({
    url: '/knowledgeAdmin/checkResult/list',
    method: 'get',
    params,
  })
}